package com.innoking.docsys.user.controller;

import com.alibaba.fastjson.JSONObject;
import com.innoking.docsys.user.module.User;
import com.innoking.docsys.utils.OtherPojo;
import com.innoking.docsys.utils.ResultObjVO;
import com.innoking.docsys.utils.ResultUtil;
import com.innoking.docsys.user.feign.UserRestInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2019/8/15.
 */
@RestController
@RequestMapping("/pay")
public class UserController {

    @Autowired
    UserRestInterface userRestInterface;

    @RequestMapping("/home")
    public ResultObjVO home() {
        System.out.println("pay service");
        OtherPojo pojo=new OtherPojo();
        pojo.setToken("1111");
        pojo.setDeviceId("2222");
        User user=new User();
        pojo.setObj(user);


        String jsonstr= JSONObject.toJSON(pojo).toString();
        return ResultUtil.success(  userRestInterface.getInfo(jsonstr)  );
    }



    @RequestMapping("/test")
    public ResultObjVO test(){
        String data="222222";

        String res= userRestInterface.test(data);

        return ResultUtil.success(res);


    }


}